<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Edit Book</title>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <h1>编辑书籍</h1>

    <form th:action="@{/books/{id}(id=${book.id})}" method="post">
        <div class="mb-3">
            <label for="name" class="form-label">书名</label>
            <input type="text" class="form-control" id="name" name="name" th:value="${book.name}" required>
        </div>
        <div class="mb-3">
            <label for="category" class="form-label">分类</label>
            <input type="text" class="form-control" id="category" name="category" th:value="${book.category}" required>
        </div>
        <div class="mb-3">
            <label for="price" class="form-label">价格</label>
            <input type="number" class="form-control" id="price" name="price" th:value="${book.price}" required>
        </div>
        <div class="mb-3">
            <label for="publisher" class="form-label">出版社</label>
            <input type="text" class="form-control" id="publisher" name="publisher" th:value="${book.publisher}" required>
        </div>
        <button type="submit" class="btn btn-primary">提交</button>
        <a href="/books/list" class="btn btn-secondary">返回</a>
    </form>
</div>
</body>
</html>
